package edu.gyc.homework;

public class Person {
    private int id;
    private String name;
    private String gender;

    public Person(int id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }


}

class Solider extends Person{


    public Solider(int id, String name, String gender) {
        super(id, name, gender);
    }

    public void kill(String name) {
        System.out.println("作为一名战士，我可以杀掉"+name);
    }

    @Override
    public boolean equals(Object obj) {
        Person p=(Person)obj;
        return this.getId()==p.getId();
    }

    public static void main(String[] args) {
        Person p = new Person(9, "张君宝", "male");
        Solider s = new Solider(9, "张三丰", "male");
       s.kill("玄冥二老");
        System.out.println(p.equals(s));
        System.out.println(s.equals(p));
    }
}